<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      div {
        width: 100px;
        height: 100px;
        background-color: peru;
        border: solid 1px black;
      }
      #d1 {
        display: inline-block;
        margin-top: 20px;
      }
      #d2 {
        display: inline-block;
      }
      #d3 {
        display: inline-block;
      }
      #d4 {
        /* 也可以单独设置某一边的间距 */
        padding: 30px;
      }
    </style>
  </head>
  <body>
    <div id="d1"></div>
    <div id="d2"></div>
    <div id="d3"></div>
    <div id="d4">大部分元素内间距为0，ul有默认内间距</div>
  </body>
</html>
